<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form name="form1">
        <h2>form1</h2>
        <p>
            name <input type="text" value="jack" name="username">
        </p>
        <p>
            email <input type="text" value="jack@qq.com" name="email">
        </p>
        <p>
            <button name="submit" id="btn">提交</button>
        </p>
    </form>
    <script>
        console.log(document.form1.username.value);
        console.log(document.form1.email.value);
        setTimeout(() => {
            document.form1.username.value = 'lili';
            document.form1.email.value = 'lili@qq.com';
        }, 3000)

    </script>
</body>

</html>